
package  main

import (
	"fmt"
	"os"
	"path"
)

type Person struct {
	Name string
	Age int
	Email string
}

func main() {

	a := "LOL"
	fmt.Println(a[1:])

	person := &Person{}

	fmt.Println(person)

	e := person.Email
	if e == "" {
		fmt.Println("email: ", e)
	}
	pathname := "log"
	filename :="xx.log"

	err := os.Mkdir(pathname, 0666)
	if err != nil {
		fmt.Println("Mkdir err",err)
	}
	file, err := os.OpenFile(path.Join(pathname, filename), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) //Create(path.Join(pathname, filename))
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println("%T", file)
	file.Close()
}